package com.czxy.service.impl;

import com.czxy.mapper.UserMapper;
import com.czxy.pojo.TUser;
import com.czxy.service.UserService;
import com.czxy.service.common.AbstractBaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author likk
 * @create 2018/9/5
 */
@Service
@Transactional
public class UserServiceImpl extends AbstractBaseService<TUser> implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public TUser findUserDetail(Integer id) {
        return userMapper.selectByPrimaryKey(id);
    }

    @Override
    public TUser findUserByUserName(String username) {
        return userMapper.findByUsername(username);
    }

    @Override
    public TUser findUserByName(String name) {
        return userMapper.findByName(name);
    }
}
